package demo1;

public class Test {
    public static void test1(Animal animal){
        animal.eat();
    }
    public static void test2(IRunning iRunning){
        iRunning.run();
    }
    public static void test3(ISwimming iSwimming){
        iSwimming.swim();
    }
    public static void test4(IFlying iFlying){
        iFlying.fly();
    }

    public static void main(String[] args) {
        test1(new Bird("小鸟",1));
        test2(new Dog("小狗",2));
        test2(new Robot());//接口实现无关类型
    }
}
